import request from '@/utils/request'

/**
 * 获取用户列表
 * @param {{
 *  status: string
 *  keyword: string
 *  tel: string
 * }} data
 * @returns
 */
export function memberList(data) {
  return request({
    url: '/member.member',
    method: 'post',
    data
  })
}

/**
 * 添加会员
 * @param {{
 *  username: string
 *  password: string
 *  nickname: string
 *  email: string
 *  mobile: string
 *  desc: string
 * }} data
 * @returns
 */
export function addMember(data) {
  return request({
    url: '/member.member/handleAdd',
    method: 'post',
    data
  })
}

/**
 * 编辑会员信息
 * @param {{
 *  uid: number
 *  username: string
 *  password: string
 *  nickname: string
 *  email: string
 *  mobile: string
 *  desc: string
 * }} data
 * @returns
 */
export function editMember(data) {
  return request({
    url: '/member.member/handleEdit',
    method: 'post',
    data
  })
}

/**
 * 更改状态
 * @param {{
 *  uid: number
 *  username: string
 *  status: DEFAULT_SWITCH_VALUE
 * }} data
 * @returns
 */
export function memberStatus(data) {
  return request({
    url: '/member.member/handleStatus',
    method: 'post',
    data
  })
}
